home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug106 / stdio.src < prev    next >
C/C++ Source or Header  |  1984-06-14  |  1KB  |  37 lines

  1. /*                stdio.src
  2.  
  3.     Copyright (C) 1980, M J Maney
  4.  
  5.     First created    3/15/80
  6.     Last revised    4/19/80 1:45
  7.  
  8.     This file defines some useful functions that are designed to help
  9.     make BDS C programs running under CP/M pretend that they're
  10.     running in a nicer environment (like UNIX, ha-ha). It makes it
  11.     easier to setup and use STDIN and STDOUT directed IO, and
  12.     although you can't just assume that they're there as you can
  13.     with UNIX C, at least you don't have to put in code to parse
  14.     the command line into each program you write: just use the
  15.     functions here.
  16. */
  17.  
  18.  
  19. #include "csym.lib"
  20. #include "stdio.lib"
  21.  
  22. #define ESCAPE '\\'
  23.  
  24.  
  25. /* stdopen parses the command line arguments looking for arguments that
  26.     begin with "<" or ">", which are respectively taken to be the
  27.     filenames for STDIN and STDOUT. The defaults are to use the
  28.     console for both STDIN and STDOUT. Any argument beginning with
  29.     "<" or ">" is effectively removed from the argument list (by
  30.     moving pointers in argv[] and decreasing argc)...if your program
  31.     wants to get an argument beginning with "<" or ">", you must
  32.     type it as "\<" or "\>", and stdopen will replace the escape
  33.     sequence in the strings, but will not "use" those arguments
  34.     for IO assignment. If you want to pass arguments beginning with
  35.     "\", you must type "\\" to escape the escape character.
  36.  
  37.     NB: the escape character is ONLY significant to stdope